package com.example.activities;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.TextView;
import com.example.R;
import com.example.adapters.TopicAdapter;
import com.example.models.UserSingleton;

/**
 * Created with IntelliJ IDEA.
 * User: dlernatovich
 * Date: 7/12/12
 * Time: 6:29 PM
 * To change this template use File | Settings | File Templates.
 */
public class UserCabinet extends Activity {

    private TextView welcomeText;
    private ListView topicList;
    private TopicAdapter adapter;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        setContentView(R.layout.user_cabinet);

        welcomeText = (TextView) findViewById(R.id.privateCabinetTextWelcome);
        topicList = (ListView) findViewById(R.id.topicList);

        adapter = new TopicAdapter(this, android.R.layout.simple_list_item_1,
                UserSingleton.getInstance().getTopics());
        topicList.setAdapter(adapter);
        welcomeText.setText("Welcome " + UserSingleton.getInstance().getUser().getUsername());

    }
}